package com.example.secondhandspringboot.utils;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class ValidUtil {

    private static final String EMAIL_PATTERN="^([a-zA-Z0-9._%+-]+)@([a-zA-Z0-9.-]+\\.)+[a-zA-Z]{2,}$";

    // 验证邮箱
    public static boolean isValidEmail(String email){
        Pattern pattern = Pattern.compile(EMAIL_PATTERN);
        Matcher matcher = pattern.matcher(email);
        return matcher.matches();
    }
}
